#pragma once


typedef unsigned (__stdcall *PTHREAD_START) (void *);

#define chBEGINTHREADEX(psa, cbStackSize, pfnStartAddr, \
   pvParam, dwCreateFlags, pdwThreadId)                 \
      ((HANDLE)_beginthreadex(                          \
         (void *)        (psa),                         \
         (unsigned)      (cbStackSize),                 \
         (PTHREAD_START) (pfnStartAddr),                \
         (void *)        (pvParam),                     \
         (unsigned)      (dwCreateFlags),               \
         (unsigned *)    (pdwThreadId)))



LPCTSTR	AppendFileName(LPTSTR lpPath, LPCTSTR lpFileName);
DWORD GetOsVersion();

BOOL NetGatewayExists();
BOOL HaveInternetConnection();


BOOL IsXPLast();

BOOL IsWin64();


int	MyGetPathType(LPCTSTR lpPath);


DWORD MyGetFileSize(LPCTSTR lpPath);

//
//LPWSTR		Ansi2Unicode(LPCSTR lpStr, DWORD nMaxLen = 0);
//LPSTR		Unicode2Ansi(LPCWSTR lpStr, DWORD nMaxLen = 0);
//LPSTR		ToUTF8Str(LPCSTR lpStr);
//LPSTR		ToUTF8Str(LPCWSTR lpStr, DWORD nMaxLen = 0);
//
//LPSTR UTF8ToAnsi(LPCSTR lpStr);
//
//LPSTR ToBase64Str(LPCWSTR lpStr);

void	ToBase64Str(LPCWSTR lpStr, CString& strBase64);
static void get_host_name(LPCTSTR lpUrl, LPCTSTR& lpHost_Begin, LPCTSTR& lpHost_End);

BOOL IsEquHostName(LPCTSTR lpUrl1, LPCTSTR lpUrl2);

CString MyGetHostName(LPCTSTR lpUrl);